package com.pan.admin.module.loanProduct.entity.qo;

import com.gitee.apanlh.util.base.StringUtils;
import com.gitee.apanlh.util.date.DateUtils;
import com.gitee.apanlh.util.date.format.DateTimeFormat;
import lombok.Data;

import java.util.List;

/**
 *  机构计划进件数查询对象
 *
 *  @author Pan
 */
@Data
public class OrgPlanApplyQO {

    /** 计划ids */
    private List<Long> listPlanId;
    /** 开始时间 */
    private String startTime;
    /** 结束时间 */
    private String endTime;

    /**
     *  创建查询对象为当天时间
     *
     *  @param  listPlanId
     *  @return OrgPlanApplyQO
     */
    public static OrgPlanApplyQO createByNowTime(List<Long> listPlanId) {
        String date = DateUtils.currentTime(DateTimeFormat.DATE_FULL);
        OrgPlanApplyQO orgPlanApplyQO = new OrgPlanApplyQO();
        orgPlanApplyQO.setListPlanId(listPlanId);
        orgPlanApplyQO.setStartTime(StringUtils.append(date, " 00:00:00"));
        orgPlanApplyQO.setEndTime(StringUtils.append(date, " 23:59:59"));
        return orgPlanApplyQO;
    }
}
